$def with (reset, msg, error)

$#
$# This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for
$# more information about the licensing of this file.
$#

$var title: $:_("Register")

$if error:
    <div class="alert alert-danger alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        $:msg
    </div>
$elif msg:
    <div class="alert alert-success alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        $:msg
    </div>

$if reset is None:
    <div class="row justify-content-center">
        <div class="col-md-6">
            <h2>$:_("Register in INGInious")</h2>
            <form method="post" class="form-horizontal">
                <div class="row">
                    <div class="col-sm-12">
                        <label class="control-label">$:_("Username (min. 4 alphanumerical characters) :") </label>
                        <input name="username" type="text" class="form-control">
                    </div>
                    <div class="col-sm-12">
                        <label class="control-label">$:_("Complete name :") </label>
                        <input name="realname" type="text" class="form-control">
                    </div>
                    <div class="col-sm-12">
                        <label class="control-label">$:_("Email address :") </label>
                        <input name="email" type="text" class="form-control">
                    </div>
                    <div class="col-sm-6">
                        <label class="control-label">$:_("Password (min. 6 characters) :") </label>
                        <input name="passwd" type="password" class="form-control">
                    </div>
                    <div class="col-sm-6">
                        <label class="control-label">$:_("Confirm password :") </label>
                        <input name="passwd2" type="password" class="form-control">
                    </div>
                    <div class="col-sm-12"><br />
                        <button type="submit" name="register" class="btn btn-primary btn-block"><i class="fa fa-sign-in"></i> $:_("Sign up")</button>
                    </div>
                </div>
            </form>
        </div>
        <div id="lostpasswd" class="col-md-6">
            <h2>$:_("Lost password ?")</h2>
            <form method="post" class="form-horizontal">
                <div class="row">
                    <div class="col-sm-12">
                        <label class="control-label">$:_("Email address :") </label>
                        <input name="recovery_email" type="text" class="form-control">
                    </div>
                    <div class="col-sm-12"><br />
                        <button type="submit" name="lostpasswd" class="btn btn-warning btn-block"><i class="fa fa-undo"></i> $:_("Reset my password")</button>
                    </div>
                </div>
            </form>

        </div>
    </div>
$else:
    <h2></h2>
    <div class="row justify-content-center">
        <div class="col-md-6">
            <div class="card">
                <div class="card-header">
                    $:_("Set new password for {} [{}]".format(reset["realname"],reset["username"]))
                </div>
                <div class="card-body">
                    <form method="post" class="form-horizontal">
                        <div class="row">
                            <div class="col-sm-6">
                                <label class="control-label">$:_("Password (min. 6 characters) :") </label>
                                <input name="passwd" type="password" class="form-control">
                            </div>
                            <div class="col-sm-6">
                                <label class="control-label">$:_("Confirm password :") </label>
                                <input name="passwd2" type="password" class="form-control">
                            </div>
                            <div class="col-sm-12"><br />
                                <input type="hidden" name="reset_hash" value="$reset['hash']">
                                <button type="submit" name="resetpasswd" class="btn btn-warning btn-block"><i class="fa fa-undo"></i> $:_("Set new password")</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
